<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class VirtualClassroom extends Model
{
    protected $fillable = [
        'student_id', 'project_name', 'status', 'score',
        'start_time', 'end_time', 'report_url', 'replay_url'
    ];

    // 关联学生（获取学生姓名、电话等信息）
    public function student()
    {
        return $this->belongsTo(Student::class, 'student_id')
                    ->select('id', 'name', 'phone', 'username');
    }
}
